<template>
  <div id="vue-admin-beautiful">
    <router-view />
  </div>
</template>

<script>
  export default {
    name: 'App',
    created() {
      // console.log(this.$router.path);
      console.log('App Created!')
      this.$router.replace(`/`) // 此处因为getUserInfo还未返回，会报一个路由守卫拦截的错误
    },
    mounted() {
      this.$store
        .dispatch('user/refreshUserToken')
        .then(() => {})
        .catch(() => {
          this.$router.replace('/login')
        })
    },
  }
</script>
